<template>
  <div>
    <van-nav-bar title="停车场详情" left-text="返回"  left-arrow @click-left="back"/>
    <div class="parkdetail">
      <div>停车场名称：{{data.parkName}}</div>
      <div>地址:{{data.address}}</div>
      <div>距离:{{data.distance}}米</div>
      <div v-if="data.open=='Y'">是否对外开放:对外开放</div>
      <div v-else>是否对外开放:不对外开放</div>
      <div>停车费:{{data.rates}}元／小时，最高收费{{data.priceCaps}}/天</div>
      <div>剩余车位:{{data.vacancy}}个</div>
      
    </div>
  </div>
</template>

<script>
import mixin from  "@/mixin/flag";
import {parkdetail} from "./Service"
export default {
  mixins:[mixin],
  data(){
    return{
      data:''
    }
  },
    methods:{
    back(){
      this.$router.go(-1);
    },
  },
  async created(){
    // console.log(this.$route.params.id);
    let res=await parkdetail({
      id:this.$route.params.id
    })
    this.data=res.data.data
    // console.log(res);
  }

}
</script>

<style lang="scss" scoped>
.parkdetail{
  font-size: 16px;
  padding-left: 20px;
  padding-top:20px;
}

</style>